package com.oig.sys.auth.constants;


public class UserEnums {

    public enum SexEnum{
        Male(1,"1","男"),
        Female(2,"0","女"),
        ;
        private final Integer gender;
        private final String code;
        private final String name;

        public String getCode() {
            return code;
        }
        public String getName() {
            return name;
        }
        public Integer getGender(){
            return gender;
        }

        SexEnum(Integer gender,String code, String name){
            this.gender = gender;
            this.code = code;
            this.name = name;
        }

        public static String getCodeByGender(Integer gender){
            for(SexEnum sexEnum: SexEnum.values()){
                if (sexEnum.getGender().equals(gender)) {
                    return sexEnum.getCode();
                }
            }
            return  null;
        }

    }


}
